import 'package:eye_flutter_app/demo/TextSpan.dart';
import 'package:eye_flutter_app/demo/box1.dart';
import 'package:eye_flutter_app/demo/box2.dart';
import 'package:eye_flutter_app/demo/box3.dart';
import 'package:flutter/material.dart';

class HomePage extends StatefulWidget {
  HomePage({Key? key}) : super(key: key);

  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("首页"),
      ),
      body: ListView(
        children: <Widget>[
          TextSpanDemo(),
          ElevatedButton(
              onPressed: () {
                Navigator.pushNamed(context, '/textField');
              },
              child: Text('TextField 文本框')),
          SizedBox(
            height: 20,
          ),
          ElevatedButton(
              onPressed: () {
                Navigator.pushNamed(context, '/checkbox');
              },
              child: Text('checkbox多选框')),
          SizedBox(
            height: 20,
          ),
          ElevatedButton(
              onPressed: () {
                Navigator.pushNamed(context, '/radio');
              },
              child: Text('Radio 单选框')),
          SizedBox(
            height: 20,
          ),
          Icon(
            Icons.account_circle,
            color: Colors.red,
          ),
          ElevatedButton(
              onPressed: () {
                Navigator.pushNamed(context, '/button');
              },
              child: Text('Button')),
          SizedBox(
            height: 20,
          ),
          ElevatedButton(
              onPressed: () {
                Navigator.pushNamed(context, '/flChart');
              },
              child: Text('fl_chart 图表')),
          SizedBox(
            height: 20,
          ),
          ElevatedButton(
              onPressed: () {
                Navigator.pushNamed(context, '/chartsFlutter');
              },
              child: Text('chart_flutter 图表')),
          ElevatedButton(
              onPressed: () {
                Navigator.pushNamed(context, '/table');
              },
              child: Text('Table 表格')),
          ElevatedButton(
              onPressed: () {
                Navigator.pushNamed(context, '/icon');
              },
              child: Text('IconFont')),
          ElevatedButton(
              onPressed: () {
                Navigator.pushNamed(context, '/demo');
              },
              child: Text('demo')),
          ElevatedButton(
              onPressed: () {
                Navigator.pushNamed(context, '/http');
              },
              child: Text('http')),
          ElevatedButton(
              onPressed: () {
                Navigator.pushNamed(context, '/storage');
              },
              child: Text('storage')),
          ElevatedButton(
              onPressed: () {
                Navigator.pushNamed(context, '/provider');
              },
              child: Text('provider')),
          ElevatedButton(
              onPressed: () {
                Navigator.pushNamed(context, '/cart');
              },
              child: Text('cart provider')),
          Text('widget自己管理状态'),
          Box1(),
          SizedBox(
            height: 20,
          ),
          Text('父组件管理子组件状态'),
          ParentWidget(),
          SizedBox(
            height: 20,
          ),
          Text('混合管理'),
          ParentWidget3(),
          // Dialog(child: Container(),)
        ],
      ),
    );
  }
}
